<!DOCTYPE html>
<html>
    <head>
        <title> 字符串操作-提取 </title>
		<meta charset="utf-8" />
    </head>
    <body>

    </body>
    <script>
         var str = "nice to meet you";
         //str.slice(start,end)
         //截取字符串包含start位置字符
         //不包含end位置字符,(空格也是字符?)
         str.slice(0,4);
         console.log(childstr);
         var str1 = str.slice(0,7);
         console.log(childstr1);
         //str.slice(start)
         //截取结果为从截取起始到整个字符串结束
         var str2 = str.slice(1);
         console.log(str2);
         //str.slice(start)
         //设定是负值，表示从右向左,确定索引位置
         var str3 = str.slice(-3);
         console.log(str3);
    </script>
</html>